//
//  GLGWImageView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "GLGWImageView.h"

@implementation GLGWImageView

-(void)setImageName:(NSString *)imageName{
    _imageName = imageName;
    self.contentMode = UIViewContentModeScaleAspectFit;
    self.image = [UIImage imageNamed:_imageName];
}

-(id)initInSuperView:(UIView *)aSuperView{
    if (self = [super init]) {
        [aSuperView addSubview:self];
    }
    return self;
}

-(id)initWithFrame:(CGRect)aFrame inSuperView:(UIView *)aSuperView{
    if (self = [self initInSuperView:aSuperView]) {
        self.frame = aFrame;
    }
    return self;
}

-(id)initWithImageName:(NSString *)aImageName inSuperView:(UIView *)aSuperView{
    if (self = [self initInSuperView:aSuperView]) {
        self.imageName = aImageName;
    }
    return self;
}

-(id)initWithFrame:(CGRect)aFrame imageName:(NSString *)aImageName inSuperView:(UIView *)aSuperView{
    if (self= [self initWithImageName:aImageName inSuperView:aSuperView]) {
        self.frame = aFrame;
    }
    return self;
}

@end
